package com.igeekhome.config;

import com.igeekhome.util.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration  //当设置了Configuration 在spring boot启动后会在类路径下扫描有没有添加@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    //拦截设置
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new Filter())   //添加拦截器对象
                .addPathPatterns("/**")   //哪些请求拦截
                .excludePathPatterns("/css/**","/fonts/**","/images/**","/js/**","/","/login","/customerService/login","/signup","/customerService/signup");
                    //哪些请求不拦截
    }
}
